package nl.hanze.designpatterns.DAO.impl.file.ser;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;


public class FileSerialize {
	
	public FileSerialize(){
		
	}
	
	public void serialize(Object object){
		try
	    {
	       FileOutputStream fileOut =
	       new FileOutputStream("..\\login2.ser");
	       ObjectOutputStream out = new ObjectOutputStream(fileOut);
	       out.writeObject(object);
	       
	       out.close();
	       fileOut.close();
	       System.out.printf("Serialized data is saved");
	    }catch(IOException i)
	    {
	        i.printStackTrace();
	    }
	}
	
}
